/*
 *  登录
 */
import { getRequest, postRequest } from '/@/lib/axios';

export const loginApi = {
  /**
   * 登录
   */
  login: (param) => {
    return postRequest('/sys/login', param);
  },

  /**
   * 退出登录
   */
  logout: () => {
    return getRequest('/sys/login/logout');
  },

  /**
   * 获取验证码
   */
  getCaptcha: () => {
    return getRequest('/sys/login/getCaptcha');
  },

  /**
   * 获取登录信息
   */
  getLoginInfo: () => {
    return getRequest('/sys/login/getLoginInfo');
  },

  /**
   * 获取邮箱登录验证码
   */
  sendLoginEmailCode: (loginName) => {
    return getRequest(`/sys/login/sendEmailCode/${loginName}`);
  },

  /**
   * 获取双因子登录标识
   */
  getTwoFactorLoginFlag: () => {
    return getRequest('/sys/login/getTwoFactorLoginFlag');
  },
};
